<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vue讲解</title>
<link href="./css/base.css" rel="stylesheet" type="text/css"/>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
</head>
<body>
<div>
    <div class="hd1">参考</div>
    <a href="https://blog.csdn.net/m0_47323674/article/details/121816439" target="_blank">Vue绑定数据的几种方式</a>
</div>
<div id="first">
    <h1>数据绑定方式1</h1>
    <div>{{type1}}</div>

    <div class="H20"></div>

    <h1>数据绑定方式2</h1>
    <input v-model="type2"></input>

    <div class="H20"></div>

    <h1>数据绑定方式3</h1>
    <div :class="class1">hello world 3</div>
    
    <div class="H20"></div>

    <h1>数据绑定方式4</h1>
    <div class="input" style="border: 1px solid red;">hello world 4</div>
    <!-- <div class="input" :style="`border:${sty3.border}`">hello world 4</div> -->
    
</div>


<script type="text/javascript">
    new Vue({
        el:'#first',
        data:{
            type1:"hello world 1",
            type2:"hello world 2",
            sty3:{
                width:'120px',
                height:'20px',
                border:'1px solid red'
            },
            class1:'class1'
        }
    })
</script>
</body>
</html>